package com.xml;

public class Dependancy {

	private Class rightClass;

	private Class leftClass;

	private int typeRelation;

	public static final int SIMPLE_POJO = 0;

	public static final int UNI_ONE_TO_MANY = 112; // 1 = UNI, 1= ONE, 2 = MANY
	public static final int BI_ONE_TO_MANY = 212; // 2 = BI, ONE = 1, MANY = 2

	public static final int UNI_ONE_TO_ONE = 111;
	public static final int BI_ONE_TO_ONE = 211;

	public static final int BI_MAY_TO_MANY = 222;
	public static final int UNI_MAY_TO_MANY = 122;

	public Dependancy(Class leftClass, Class rightClass, int typeRelation) {
		this.rightClass = rightClass;
		this.leftClass = leftClass;
		this.typeRelation = typeRelation;
	}

	public boolean hasSameExtremities(Dependancy d) {

		return (d.rightClass == rightClass && d.leftClass == leftClass);
	}

	@Override
	public String toString() {
		return leftClass.getName() + "------" + typeRelation + "--------" + rightClass.getName();
	}

	public Class getRightClass() {
		return rightClass;
	}

	public void setRightClass(Class rightClass) {
		this.rightClass = rightClass;
	}

	public Class getLeftClass() {
		return leftClass;
	}

	public void setLeftClass(Class leftClass) {
		this.leftClass = leftClass;
	}

	public int getTypeRelation() {
		return typeRelation;
	}

	public void setTypeRelation(int typeRelation) {
		this.typeRelation = typeRelation;
	}

}
